package com.frame.work.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class RedisUtil {
    @Autowired
    private RedisTemplate redisTemplate;

    private static RedisUtil redisUtilStatic;

    @PostConstruct
    public void init() {
        redisUtilStatic = this;
    }

    public static RedisTemplate getRedisTemplate(){
        return redisUtilStatic.redisTemplate;
    }
}